package jspx.example.interceptor.db;

import com.github.jspxnet.sioc.annotation.Bean;
import com.github.jspxnet.sober.Interceptor;
import com.github.jspxnet.sober.SoberSupport;
import jspx.example.env.DemoIoc;
import java.util.Map;

@Bean(bind = IntDemoInterceptor.class,namespace = DemoIoc.namespace)
public class IntDemoInterceptor implements Interceptor {
    @Override
    public void destroy() {

    }

    @Override
    public void init() {

    }

    @Override
    public void before(SoberSupport soberSupport, Map<String, Object> valueMap) throws Exception {
        System.out.println("-------IntDemoInterceptor test =" + valueMap.get("test"));
    }

    @Override
    public Object after(SoberSupport soberSupport, Map<String, Object> valueMap, Object result) throws Exception {
        System.out.println("1-------IntDemoInterceptor after =" + result);
        result = 10;
        System.out.println("2-------IntDemoInterceptor after =" + result);
        return result;
    }
}
